<extend name="Public/base"/>

<block name="body">
	<div class="main-title">
		<h2>直播视频 [ <present name="Think.get.group">
         <a href="{:U('index')}">全部</a><else/><strong>全部</strong></present>&nbsp;<foreach name="group" item="vo">
		<neq name="group_id" value="$key">
         <a href="{:U('index?group='.$key)}">{$vo}</a><else/><strong>{$vo}</strong></neq>&nbsp;     
        </foreach> ]</h2>
	</div>

	<div class="cf">
		<a class="btn" href="{:U('add')}">新 增</a>
		  <button class="btn ajax-post confirm" url="{:U('del')}" target-form="ids">删 除</button>
        <div class="search-form fr cf">
            <div class="sleft">
                <input type="text" name="title" class="search-input" value="{:I('title')}" placeholder="请输入视频名称">
                <a class="sch-btn" href="javascript:;" id="search" url="__SELF__"><i class="btn-search"></i></a>
            </div>
        </div>
	</div>

	<div class="data-table table-striped">
		<table class="">
			<thead>
			<tr>
				<th class="row-selected">
					<input class="checkbox check-all" type="checkbox">
				</th>
				<th>ID</th>
				<th class="">视频标题</th>
				<th class="" style="width: 400px;">视频地址</th>
				<th class="">状态</th>
				<th class="">创建时间</th>
				<th class="">操作</th>
			</tr>
			</thead>
			<tbody>
			<notempty name="list">
			<volist name="list" id="vo">
				<tr>
					<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$vo.id}"></td>
					<td class="">{$vo.id}</td>
					<td class="">{$vo.title}</td>
					<td class="">{$vo.url}</td>
					<td>
						<eq name="vo.status" value="1">已展示<else/>未展示</eq>
					</td>
					<td class="">{$vo.create_time|date='Y-m-d H:i:s',###}</td>
					<td>
						<a href="{:U('edit',array('id'=>$vo['id']))}">编辑</a>
						<a href="{:U('active',array('id'=>$vo['id'],'status'=>'1'))}" class="confirm ajax-get">启用</a>
						<a href="{:U('active',array('id'=>$vo['id'],'status'=>'0'))}" class="confirm ajax-get">禁用</a>
						<a href="{:U('del',array('id'=>$vo['id']))}" class="confirm ajax-get">删除</a>
					</td>
				</tr>
			</volist>
			<else/>
			<td colspan="6" class="text-center"> aOh! 暂时还没有内容! </td>
			</notempty>
			</tbody>
		</table>
        <!-- 分页 -->
        <div class="page">
{$_page}
        </div>
	</div>
</block>

<block name="script">
 <script type="text/javascript">
        $(function() {
            //搜索功能
            $("#search").click(function() {
                var url = $(this).attr('url');
                var query = $('.search-form').find('input').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });
            //回车搜索
            $(".search-input").keyup(function(e) {
                if (e.keyCode === 13) {
                    $("#search").click();
                    return false;
                }
            });
            //导航高亮
            highlight_subnav("{:U('index')}");
        });
    </script>
</block>